Skip to content

Fix BuildManifestBuilder.append_artifact to safely initialize artifact lists #5525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aravindkesavan
Copy link

Type of change

  • Bug Fix / Improvement

Description

This change fixes a bug in the BuildManifestBuilder.append_artifact method where the artifact list was not safely initialized. Previously, the code retrieved the list using artifacts.get(type, []) but did not always assign the empty list back to the dictionary, which could lead to cases where the list was not properly stored or updated.

The fix ensures that if the artifact type key does not exist or is not a list, an empty list is explicitly assigned before appending the new artifact path.

Issues Resolved

No specific issue number was referenced, but this fix improves the stability of the build manifest creation logic.

Note: Fixes initialization of artifact lists in BuildManifestBuilder.append_artifact. Ensures the artifact type key always holds a list before appending, preventing potential errors during build manifest creation.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@aravindkesavan aravindkesavan force-pushed the fix-artifacts-list-initialization branch from b3c934c to 2999814 Compare May 19, 2025 19:45
@peterzhuamazon
Copy link
Member

Hi @aravindkesavan ,

Thanks for PR.
Do you have an example of the failures before this fix?
Trying to understand about it because I have not see issues related to this before. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants